package com.hitown.service.impl.dxhd;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hitown.dao.dxhd.DxhdAblxMapper;
import com.hitown.model.dxhd.DxhdAblx;
import com.hitown.model.dxhd.DxhdJq;
import com.hitown.service.dxhd.DxhdAblxService;
import com.hitown.util.PageVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 安保路线信息表 服务实现类
 * </p>
 *
 * @author menu
 * @since 2021-07-19
 */
@Service
public class DxhdAblxServiceImpl extends ServiceImpl<DxhdAblxMapper, DxhdAblx> implements DxhdAblxService {

    @Autowired
    private DxhdAblxMapper dxhdAblxMapper;

    @Override
    public PageVo<DxhdAblx> myquery(Long current, Long limit, DxhdAblx dxhdAblx) {

        //初始化page
        Page<DxhdAblx> page = new Page<>(current,limit);
        //设置条件
        QueryWrapper<DxhdAblx> wrapper =new QueryWrapper<>();
        //eq是等于，ge是大于等于，gt是大于，le是小于等于，lt是小于，like是模糊查询

        //执行查询
        dxhdAblxMapper.selectPage(page,wrapper);
        List<DxhdAblx> list = page.getRecords();
        PageVo<DxhdAblx> userVo =new PageVo();
        userVo.setSize(page.getSize());
        userVo.setTotal(page.getTotal());
        userVo.setCurrent(page.getCurrent());
        userVo.setUserList(list);
        return userVo;
    }

    /*@Override
    public boolean save(DxhdAblx entity) {
        return dxhdAblxMapper.insert(entity);
    }*/
}
